import React, {Component, Fragment} from "react";
import TaskItem from "./TaskItem";

export default class TaskList extends Component {
    constructor(props) {
        super(props);
    }

    render() {
        if (this.props.taskList.length <= 0) {
            return null;
        }
        return (
            <Fragment>
            {this.props.taskList.map((item, idx) => {
                return <TaskItem key={item.text} task={item} onActive={this.props.onActive}
        onFinish={this.props.onFinish} onDel={this.props.onDel}/>
    })}
    </Fragment>
    );
    }
}
